home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 1
/
Gekikoh Dennoh Club Vol. 1 (Japan).7z
/
Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin
/
tools
/
xb
/
fncsrc
/
spdef.has
< prev
Wrap
Text File
|
1995-06-03
|
3KB
|
186 lines
.include doscall.mac
.include iocscall.mac
.include fdef.h
.dc.l ret0
.dc.l ret0
.dc.l ret0
.dc.l ret0
.dc.l ret0
.dc.l ret0
.dc.l ret0
.dc.l ret0
.dc.l ptr_token
.dc.l ptr_param
.dc.l ptr_exec
.dc.l 0,0,0,0,0
ptr_token:
.dc.b 'spfile_def',0
.dc.b 'palfile_def',0
.dc.b 0
.even
ptr_param:
.dc.l p_sp_def
.dc.l p_pal_def
*-------------------
p_sp_def:
p_pal_def:
.dc.w str_val
.dc.w int_val
.dc.w int_ret
*-------------------
ptr_exec:
.dc.l e_sp_def
.dc.l e_pal_def
******************************
SP_PTR equ $eb8000
SP_PTR_END equ $ec0000
PAL_PTR equ $e82200
PAL_PTR_END equ $e82400
******************************
e_sp_def:
clr.l -(sp)
DOS _SUPER
move.l d0,(sp)
link a6,#-$80
bsr sp_check
bmi screen_mode_err
move.l 8+par2+6(a6),d1
* move.l #$100-1,d2
moveq #0,d2
subq.b #1,d2 * $000000ff
sub.l d1,d2
bcs para_err
lea.l SP_PTR,a1
lsl.l #7,d1
add.l d1,a1
clr.w -(sp)
move.l 8+par1+6(a6),-(sp)
DOS _OPEN
tst.l d0
bmi no_file_err
lea.l -$80(a6),a2
moveq #$80/4-1,d1
move.l #$80,-(sp)
bra sub
*-------------------------
e_pal_def:
clr.l -(sp)
DOS _SUPER
move.l d0,(sp)
link a6,#-$20
bsr sp_check
bmi screen_mode_err
move.l 8+par2+6(a6),d1
moveq.l #$10-1,d2
sub.l d1,d2
bcs para_err
lea.l PAL_PTR,a1
lsl.l #5,d1
add.l d1,a1
clr.w -(sp)
move.l 8+par1+6(a6),-(sp)
DOS _OPEN
tst.l d0
bmi no_file_err
lea.l -$20(a6),a2
moveq #$20/4-1,d1
move.l #$20,-(sp)
sub:
move.l a2,-(sp)
move.w d0,-(sp)
1:
DOS _READ
tst.l d0
ble 2f
movea.l a2,a0
move.w d1,d0
@@:
move.l (a0)+,(a1)+
dbra d0,@b
dbra d2,1b
2:
DOS _CLOSE
*-------------------------
return_zero:
moveq.l #0,d0
return_d0:
lea.l fac(pc),a0
move.l d0,6(a0)
moveq.l #0,d2
ret:
unlk a6
DOS _SUPER
addq.l #4,sp
move.l d2,d0
ret0:
rts
****************************
screen_mode_err:
lea.l screen_mode_err_mes(pc),a1
moveq.l #-1,d2
bra ret
no_file_err:
lea.l no_file_err_mes(pc),a1
moveq.l #-2,d2
bra ret
para_err:
lea.l para_err_mes(pc),a1
moveq.l #-3,d2
bra ret
****************************
sp_check:
moveq.l #0,d1
IOCS _SP_REGGT
tst.l d0
rts
****************************
fac:
.dc.w 0
.dc.l 0,0
screen_mode_err_mes:
.dc.b '画面モードが不正です',0
no_file_err_mes:
.dc.b 'ファイルがありません',0
para_err_mes:
.dc.b 'パラメータが異常です',0
.even
.end